#include <string>
#include <sstream>
using std::string;
using std::stringstream;

template <typename T>
void stringTo(const string &str, T &val)
{
    stringstream sstream;
    sstream << str;
    sstream >> val;
}

template <typename T>
void toString(string &str, const T &val)
{
    stringstream sstream;
    sstream << val;
    // str = sstream.str();
    sstream >> str;
}